package com.server.impl;

import com.dao.OrderForm.OrderFormMapper;
import com.entry.OrderForm;
import com.server.OrderFormService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class OrderFormServiceImpl implements OrderFormService {
    @Resource
    OrderFormMapper orderFormMapper;


    @Override
    public int addOrderForm(String order_code, String order_addres, String order_receiver, String mobile, Date create_date, int user_id, int status, String body, int total_amount, String subject) {
        return orderFormMapper.addOrderForm(order_code, order_addres, order_receiver, mobile, create_date, user_id, status, body, total_amount, subject);
    }

    @Override
    public int addAllOrderForm(String order_code, String order_addres, int order_posts, String order_receiver, String mobile, String user_message, Date create_date, Date pay_date, Date delivery_date, int user_id, Date confirm_date, int status, String body, int total_amount, String subject) {
        return orderFormMapper.addAllOrderForm(order_code, order_addres, order_posts, order_receiver, mobile, user_message, create_date, pay_date, delivery_date, user_id, confirm_date, status, body, total_amount, subject);
    }

    /*@Override
    public int addAllOrderForm(String order_code, String order_addres, int order_posts, String order_receiver, String mobile, String user_message, Date create_date, Date pay_date, Date delivery_date, int user_id, Date confirm_date, int status, String body, int total_amount, String subject) {
        return orderFormMapper.addAllOrderForm(order_code, order_addres, order_posts, order_receiver, mobile, user_message, create_date, pay_date, delivery_date, user_id, confirm_date, status, body, total_amount, subject);
    }*/

    @Override
    public OrderForm getOrderFormByOrderCode(String order_code) {
        return orderFormMapper.getOrderFormByOrderCode(order_code);
    }

    @Override
    public List<OrderForm> getOrderSell(int user_id) {
        return orderFormMapper.getOrderSell(user_id);
    }

    @Override
    public List<OrderForm> getOrderSellandStatus(int user_id, int status) {
        return orderFormMapper.getOrderSellandStatus(user_id, status);
    }

    @Override
    public int updateOrderStatus(int status, String order_code) {
        return orderFormMapper.updateOrderStatus(status, order_code);
    }

    @Override
    public int deleteOrderForm(String order_code) {
        return orderFormMapper.deleteOrderForm(order_code);
    }

    @Override
    public int modifyOrderStatus_pay_date(int status, Date pay_date, String order_code) {
        return orderFormMapper.modifyOrderStatus_pay_date(status, pay_date, order_code);
    }

    @Override
    public int modifyOrderStatus_confirm_date(int status, Date confirm_date, String order_code) {
        return orderFormMapper.modifyOrderStatus_confirm_date(status, confirm_date, order_code);
    }


}
